<?php
require('my_ui.inc');
require('my_cn.inc');
require('my_db.inc');
ui_print_header('control');
$admin = false; 
session_start();
if(isset($_SESSION['admin'])&&$_SESSION['admin']==true)
{
	construct_control();
}
else{	
		echo '<p>you need to login </p>';
		ui_print_login_form('login.php');
}
function construct_control()
{
	if(isset($_POST['viewall'])){
		view_all();
	}
	elseif(isset($_POST['modify']))
	{
		construct_modify();
	}
	elseif(isset($_POST['savemodify']))
	{
		modify_user();
	}
	else
	{
		construct_overview();
	}
}

/*
 * function view all produce a view for all projects, forum post belong to the user
* */
function view_all(){
	
}
/*
 * construct a view of user info,such as password,location, other than posts
* for futher modify
* */
function construct_modify()
{
	
}
/*
 * save the modified info and write to database;
*/
function modify_user()
{
	
}

/*
 * construct the outlines, maybe 3 buttons :-)
* */
function construct_overview()
{
	
}
ui_print_footer(date('Y-m-d H:i:s'));
?>